/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package cn.ac.iie.di.ban.news.server.check.checkers;

import cn.ac.iie.di.ban.news.server.check.CheckResult;
import cn.ac.iie.di.ban.news.server.check.Checker;

/**
 *
 * @author zwlin
 */
public class QQChecker implements Checker<String, Object> {

    @Override
    public CheckResult check(String src, Object target) {
        try {
            if (null == src || (src = src.trim()).isEmpty()) {
                return new CheckResult();
            }
            long l = Long.parseLong(src.trim());
            if (l < 10000 || l > 99999999999999L) {
                throw new Exception();
            }
            return new CheckResult();
        } catch (Exception e) {
            return new CheckResult("not valid QQ number.");
        }
    }

}
